/* 初始化样式 */
* {
    margin: 0;
    padding: 0;
}

/* 页面基础样式（模拟夜空） */
body {
    height: 100vh; /* 100%视口高度 */
    overflow: hidden; /* 溢出隐藏 */
}

/* 容器样式（承载背景+流星） */
.container {
    position: absolute; /* 绝对定位 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("../work2/space.jpg") no-repeat; /* 背景图 */
    background-size: cover; /* 背景图铺满容器 */
    background-position-x: center; /* 背景图水平居中 */
    animation: animateBg 5s linear infinite; /* 背景缩放动画 */
}


/* 单个流星基础样式 */
span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background-color: #ffffff;
    border-radius: 50%;
    /* 发光效果 */
    box-shadow: 0 0 4px rgba(255,255,255,0.1),
                0 0 8px rgba(255,255,255,0.1),
                0 0 20px rgba(255,255,255,1);
    animation: animate 3s linear infinite; /* 流星划过动画 */
}

/* 流星拖尾效果（伪元素） */
span::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 3px;
    background: linear-gradient(90deg, #ffffff, transparent); /* 白色→透明的渐变拖尾 */
}

/* 背景缩放动画（让背景有呼吸感） */
@keyframes animateBg {
    0%,100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* 流星划过动画（旋转+平移） */
@keyframes animate {
    0% {
        transform: rotate(315deg) translateX(0);
        opacity: 1;
    }
    100% {
        transform: rotate(315deg) translateX(-1000px); /* 向斜下方平移 */
        opacity: 0;
    }
}

/* 为每个流星单独设置：位置、动画延迟、动画时长（实现随机流星效果） */
span:nth-child(1) {
    top: 0;
    right: 0;
    left: initial;
    animation-delay: 0s;
    animation-duration: 1s;
}
span:nth-child(2) {
    top: 0;
    right: 80px;
    left: initial;
    animation-delay: 0.2s;
    animation-duration: 3s;
}
span:nth-child(3) {
    top: 80px;
    right: 0;
    left: initial;
    animation-delay: 0.45s;
    animation-duration: 2s;
}
span:nth-child(4) {
    top: 0;
    right: 180px;
    left: initial;
    animation-delay: 0.6s;
    animation-duration: 1.5s;
}
span:nth-child(5) {
    top: 0;
    right: 400px;
    left: initial;
    animation-delay: 0.8s;
    animation-duration: 2.5s;
}
span:nth-child(6) {
    top: 0;
    right: 600px;
    left: initial;
    animation-delay: 1s;
    animation-duration: 3s;
}
span:nth-child(7) {
    top: 300px;
    right: 0;
    left: initial;
    animation-delay: 1.2s;
    animation-duration: 1.75s;
}
span:nth-child(8) {
    top: 0;
    right: 700px;
    left: initial;
    animation-delay: 1.4s;
    animation-duration: 1.25s;
}
span:nth-child(9) {
    top: 0;
    right: 1000px;
    left: initial;
    animation-delay: 0.75s;
    animation-duration: 2.25s;
}
span:nth-child(10) {
    top: 0;
    right: 450px;
    left: initial;
    animation-delay: 2.75s;
    animation-duration: 2s;
}